using DG.Tweening;
using Dream.Dialogue.Base;
using Light;
using UnityEngine;

//mao 24-11-23 02:46
namespace Dream.Dialogue.Implement
{
    public class TimerTalk : TalkBase
    {
        //自动说话的间隔时间
        [SerializeField] private float timerDuration = 5f;

        /// <summary>
        ///     自定义的时间类
        /// </summary>
        //mao 24-11-23 02:46
        private OnceTimer onceTimer;

        private void Start()
        {
            //注册等待时间和方法
            onceTimer = new OnceTimer(timerDuration, Talk);
            onceTimer.StartTimer();
        }

        public override void SetWord(string talkText)
        {
            words = talkText;
        }

        public override void Talk()
        {
            text.DOText(words, time);
        }

        public override bool StartTalk()
        {
            return true;
        }
    }
}